<template>
		<modal :show="popup" @cancel="()=> this.popup = false" :maskClosable="false">
			<view class="flex flex-direction align-center justify-center">
				<view class="text-lg text-black text-bold">{{title}}</view>
				<view style="font-size: 120rpx;" class="icon-roundcheck text-green margin-tb"></view>
				<view class="flex justify-between">
					<view @click="goHome" class="margin-lr cu-btn round shadow-blur bg-orange">返回首页</view>
					<view @click="onBtn" class="margin-lr cu-btn round shadow-blur bg-green">{{btntext}}</view>
				</view>
			</view>
		</modal>
</template>

<script>
	import Modal from "@/components/popup-layer/modal.vue"
	export default {
		components:{
			Modal
		},
		props: {
			title: {
				type: String,
				default: '支付成功!'
			},
			btntext: {
				type: String,
				default: '查看订单'
			},
			url: {
				type: String,
				default: '/pages/Order/List/List'
			}
		},
		data() {
			return {
				popup: false
			};
		},
		methods: {
			show() {
				this.popup = true
			},
			close() {
				this.popup = false
			},
			goHome() {
				this.close()
				setTimeout(()=> uni.switchTab({
					url: '/pages/Tab/BuyTicket/BuyTicket'
				}),300)
				
			},
			onBtn() {
				this.close()
				setTimeout(()=> uni.redirectTo({
					url: this.url
				}),300)
				
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
